package com.byfan.barter.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author: FBY
 * @Description
 * @Version 1.0
 * @Date: 2021/5/14 13:11
 */
@Entity
@Data
@EntityListeners(AuditingEntityListener.class)
@ApiModel
@Table(name = "user")
public class User implements Serializable {

    @ApiModelProperty(value = "用户openId")
    @Id
    @Column(name = "openid")
    private String openId;   //用户唯一id

    @ApiModelProperty(value = "昵称")
    @Column(name = "nick_name")
    private String nickName;   //用户昵称

    @ApiModelProperty(value = "性别（0:未知;1:男性;2:女性）")
    @Column(name = "gender")
    private Integer gender;   //用户性别，0:未知;1:男性;2:女性;

    @ApiModelProperty(value = "头像地址")
    @Column(name = "avatarurl")
    private String avatarUrl;   //用户头像地址路径

    @ApiModelProperty(value = "注册地区（China/Henan/Zhengzhou）")
    @Column(name = "address")
    private String address;   //用户注册地区  China/Henan/Zhengzhou

    @ApiModelProperty(value = "注册小程序的时间（不用传参）")
    @CreatedDate
    @Column(name = "creat_time")
    private Date creatTime;   //用户注册小程序时间
}
